#include <iostream>
#include <sstream>
#include <string>
using std::cout;
using std::endl;
using std::istringstream;
using std::string;

void test0(){
    /* string s("hello 456"); */
    /* string s("456 world"); */

    string s("123 456");
    int num = 10;
    int num2 = 20;
    //利用string初始化字符串输入流对象iss
    //在iss对象的缓冲区中会保存一份string内容的副本
    istringstream iss(s);
    iss >> num >> num2;
    cout << "num:" << num << endl;
    cout << "num2:" << num2 << endl;
}

int main(void){
    test0();
    return 0;
}
